const classDao = require('../dao/classDao');

module.exports.findAll = async function(){
    return await classDao.findAll();
}



module.exports.find = async function(page,searchParams){
    return await classDao.find(page,searchParams);
}

module.exports.updateIndex = async function(classId,currentIndex,incOrDec){
    let cls = await classDao.findById(classId);
    await classDao.updateIndex(cls.index,currentIndex,incOrDec);
    cls.index = currentIndex;
    return await classDao.update(cls);
}